#include <iostream>
using namespace std;

int GCD(int a, int b) {
	int t;
	while (a>0) {
		if (a<b) {
			t=a; a=b; b=t;
		}
		a=a%b;
	}
	return b;
}

int main() {
	int a, b, c;
	cin >> a >> b;
	c = GCD(a, b);
	cout << c << endl;
	cout << a*b/c << endl;
	return 0;
}
